const express = require('express');
const admin = express.Router();

admin.get("/", (req, res) => {
    res.send('欢迎来到管理');
});
//渲染登录页面和用户管理页面
admin.get('/login', require('./admin/loginPage'));
admin.get('/user', require('./admin/userPage'));
admin.post('/login', require('./admin/login'));
admin.get('/user-edit', require('./admin/userEditPage'))
admin.post('/user-add', require('./admin/userAdd'));
admin.post('/user-edit', require('./admin/userEdit'));
admin.get('/delete', require('./admin/deleteUser'));
admin.get('/article', require('./admin/article'));
admin.get('/article-edit', require('./admin/articleEditPage'));
admin.post('/article-add', require('./admin/articleAdd'));
admin.get('/article-delete', require('./admin/article-delete'));
admin.get('/logout', require('./admin/logout'));

module.exports = admin;